home *** CD-ROM | disk | FTP | other *** search
- class SO
- {
- static var root;
- static var onExternalInit;
- static var externalSOPath;
- static var lso;
- static var mcl;
- static var eso;
- static var externalSODomain = "http://projects.kempt.co.uk/";
- static var externalSOPathEnd = "/swf/so.swf";
- function SO()
- {
- }
- static function init(r, name, oei)
- {
- SO.root = r;
- SO.onExternalInit = oei;
- System.security.allowDomain(SO.externalSODomain);
- SO.externalSOPath = SO.externalSODomain + name + SO.externalSOPathEnd;
- SO.lso = SharedObject.getLocal(name,"/");
- SO.mcl = new MovieClipLoader();
- SO.mcl.addListener(SO);
- SO.mcl.loadClip(SO.externalSOPath,SO.root.createEmptyMovieClip("eso_mc",SO.root.getNextHighestDepth()));
- }
- static function onLoadComplete(targ)
- {
- trace("external swf loaded!");
- SO.eso = targ.getSO();
- if(SO.eso.data._setData)
- {
- for(var _loc1_ in SO.eso.data)
- {
- SO.lso.data[_loc1_] = SO.eso.data[_loc1_];
- }
- SO.lso.flush();
- }
- else if(SO.lso.data._setData)
- {
- for(_loc1_ in SO.lso.data)
- {
- SO.eso.data[_loc1_] = SO.lso.data[_loc1_];
- }
- SO.eso.flush();
- }
- SO.onExternalInit();
- }
- static function getVar(n)
- {
- return SO.lso.data[n];
- }
- static function setVar(n, v)
- {
- if(SO.eso)
- {
- SO.eso.data._setData = true;
- SO.eso.data[n] = v;
- SO.eso.flush();
- }
- SO.lso.data._setData = true;
- SO.lso.data[n] = v;
- SO.lso.flush();
- }
- static function clearSO()
- {
- for(var _loc1_ in SO.lso.data)
- {
- delete SO.lso.data[_loc1_];
- }
- SO.lso.flush();
- for(_loc1_ in SO.eso.data)
- {
- delete SO.eso.data[_loc1_];
- }
- SO.lso.flush();
- }
- }
-